home *** CD-ROM | disk | FTP | other *** search
/ Enter 2002 September / EnterCD 9_2002.iso / Multimedia / DJ Mix Pro 3.0 / djmixprosetup.exe / #setuppath# / plugins / sdk / DJMixPlugin.h < prev    next >
Encoding:
C/C++ Source or Header  |  2002-07-22  |  2.2 KB  |  73 lines

  1. //
  2. //        DJ Mix Pro plugin
  3. //
  4. //      (C) 2001 Beatlock Technology
  5. //
  6. //
  7. //      Allows to build graphical animations synchronized with music played in the DJ Mix Pro program
  8. //      Allows to manage lights synchronized with music played in the DJ Mix Pro program
  9. //      Allows to synchronize things in general with music played in the DJ Mix Pro program
  10. //
  11. //      
  12. //    The resulting DLL is to be dropped in the DJ Mix Pro 
  13. //    plugins folder. It will appear automaticaly in 
  14. //  the action menu, visualisation plugin submenu
  15. //
  16.  
  17.  
  18.  
  19. #if !defined(DJMIXPLUGIN_INCLUDED)
  20. #define DJMIXPLUGIN_INCLUDED
  21.  
  22.  
  23. //if you dont have winuser.h
  24. //#define WM_USER       0x0400
  25. #include <winuser.h>
  26.  
  27.  
  28. //if your plugin decides to exit, you MUST just post a 
  29. //PLUGGINUNLOADED message to the managing window
  30. //using a call like this :
  31. //    SendMessage(parent, PLUGGINUNLOADED, 0, 0);  
  32. //in this case, Unload will still be called, so 
  33. //perform your cleanup in Unload method
  34. #define PLUGGINUNLOADED WM_USER+51
  35.  
  36.  
  37. //your plugin must inherit this class and 
  38. //implement at least the 4 pure virtual methods
  39. //
  40. // class YourPlugin : public DJMixPlugin { ... };
  41. //
  42. class DJMixPlugin  
  43. {
  44. public:
  45.     DJMixPlugin(){};
  46.     virtual ~DJMixPlugin(){};
  47.  
  48.     //developer of a plugin MUST implement these
  49.     //Dont rely on constructor and destructor,
  50.     //they will be called more than expected.
  51.     //Do construction in load and destruction in unload
  52.     //You have enough parameters to create windows if you want
  53.     virtual void Load( HINSTANCE instance,HWND parent)=0;
  54.     virtual void Unload( )=0;
  55.     virtual char* GetName() = 0;
  56.     //refresh will be called about 20 times per second
  57.     //where is the pos in seconds in current song
  58.     //closest is the beat position closest to position in current song
  59.     //which is the closest beat number in current song
  60.     //uses the number to check the discontinuity if needed
  61.     virtual void Refresh(double where, double closest, long which) = 0;
  62. };
  63.  
  64. //Your plugin DLL must export one C function called "CreateFunc"
  65. //used to create one object of this class
  66. //extern "C"
  67. //__declspec( dllexport )  DJMixPlugin* CreateFunc() {
  68. //    return new YourPlugin();
  69. //}
  70. typedef DJMixPlugin*  (*pluginCreateFunc) ();
  71.  
  72. #endif
  73.